package com.gmako.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.gmako.dao.BaseDAO;
import com.gmako.entity.Adress;
import com.gmako.entity.Businessinfo;
import com.gmako.service.AddressService;
@Service
public class AddressServiceImpl implements AddressService {
	@Autowired
	private BaseDAO baseDAO;
	/**
	 * 根据ID查询区域地址信息
	 * @author yezhenchi
	 * @param class
	 * @param propertyName
	 * @param value
	 * @return
	 */
	@SuppressWarnings("unchecked")
	public List<Adress> findByProperty(Class clazz, String propertyName,
			Object value) {
		return (List<Adress>) baseDAO.findByProperty(clazz.getName(), propertyName, value);
	}
	
	/**
	 * 根据ID查询区域地址信息
	 * @author yezhenchi
	 * @param class
	 * @param propertyName
	 * @param value
	 * @return
	 */
	public Adress findAdressName(int id){
		String hql = "from Adress where id="+id;
		return (Adress)baseDAO.loadObject(hql);
	}

}
